package com.yxzx.common;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 自定义异常处理类
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiModel("全局异常")
public class EduException extends RuntimeException {
    @ApiModelProperty("状态码")
    private Integer code;//状态码
    @ApiModelProperty("异常信息")
    private String message;//异常信息

    public String toString(){
        return "EduException { message=" + this.getMessage() + ",code = " + code +"}";
    }
}
